package com.yhyvr.pojo.resp.api.user;

import com.lz.kit.PropKit;
import com.yhyvr.pojo.ApiConstant;
import com.yhyvr.pojo.resp.api.ApiRespBody;
import org.apache.commons.lang3.StringUtils;

/**
 * Created by tech6 on 2016/10/27.
 */
public class ApiUserInfoResp extends ApiRespBody{

    private String phone;
    private String phoneSub;
    private String nickName;
    private boolean identifyAuth;
    private String headImage;
    private Integer sex;
    private int userType;
    private int isTaster;

    public int getIsTaster() {
        return isTaster;
    }

    public void setIsTaster(int isTaster) {
        this.isTaster = isTaster;
    }

    public String getPhone() {
        if(StringUtils.isNotBlank(phone)) {
            StringBuffer str = new StringBuffer();
            if (phone.length() == 11) {
                str.append(phone.substring(0, 3));
                str.append("****");
                str.append(phone.substring(7, 11));
                return str.toString();
            }
            return phone;
        }else{
            return phone;
        }
    }

    public String getPhoneSub() {
        return phoneSub;
    }

    public void setPhoneSub(String phoneSub) {
        this.phoneSub = phoneSub;
    }

    public boolean isIdentifyAuth() {
        return identifyAuth;
    }

    public void setIdentifyAuth(boolean identifyAuth) {
        this.identifyAuth = identifyAuth;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getHeadImage() {
        if(StringUtils.isBlank(headImage)){
            return ApiConstant.HEAD_IMAGE+"@1000-1ci.png";
        }
        return headImage+"@1000-1ci.png";
    }

    public int getUserType() {
        return userType;
    }

    public void setUserType(int userType) {
        this.userType = userType;
    }

    public void setHeadImage(String headImage) {
        this.headImage = headImage;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }
}
